<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #cart{
            margin: 0 auto;
            margin-top: 100px;
            text-align: center;
            border: solid 1px red;
            width: 180px;
            height: 40px;
            background-color: antiquewhite;
            line-height: 40px;
            position: relative;
        }
        #cart>span{
            width: 20px;
            height: 20px;
            background-color: red;
            color: #fff;
            position: absolute;
            top: -5px;
            text-align: center;
            line-height: 20px;
            border-radius: 10px 10px 10px 0;

        }
    </style>
</head>
<body>
    <div id="cart">
        我的购物车
        <span>1</span>
    </div>
</body>
</html>